import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/home')
  },
  {
    path: '/leave',
    name: 'leave',
    component: () => import('@/views/leave')
  },
  {
    path: '/onecard',
    name: 'onecard',
    component: () => import('@/views/one-card')
  },
  {
    path: '/pay',
    name: 'pay',
    component: () => import('@/views/pay')
  },
  {
    path: '/mine',
    name: 'mine',
    component: () => import('@/views/mine')
  },
  {
    path: '/payCard',
    component: () =>
      import('@/views/pay/child/one-card-recharge/one-card-recharge.vue')
  },
  {
    path: '/payBookFee',
    component: () => import('@/views/pay/child/pay-book-fee/pay-book-fee.vue')
  },
  {
    path: '/payInfo',
    component: () => import('@/views/pay/child/pay-info/pay-info.vue')
  },
  {
    path: '/payRoom',
    component: () => import('@/views/pay/child/pay-room/pay-room.vue')
  },
  {
    path: '/payTuition',
    component: () => import('@/views/pay/child/pay-tuition/pay-tuition.vue')
  },
  {
    path: '/payHydropower',
    component: () =>
      import('@/views/pay/child/pay-hydropower/pay-hydropower.vue')
  },
  {
    path: '/studentLeave',
    component: () =>
      import('@/views/mine/child/student-leave/student-leave.vue'),
    children: [
      {
        path: '',
        redirect: '/studentLeave/application'
      },
      {
        path: 'application',
        component: () =>
          import('@/views/mine/child/student-leave/application/application.vue')
      },
      {
        path: 'info',
        component: () =>
          import('@/views/mine/child/student-leave/info/info.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
